package com.fxu.framework.core.sql;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.io.Serializable;

/**
 * SQL 执行类型
 *
 * @author fangxu
 * @version 1.0.0
 */
@Getter
@AllArgsConstructor
public enum SType implements Serializable {
    AND("AND"),
    OR("OR"),
    NOT("NOT"),
    IN("IN"),
    NOT_IN("NOT IN"),
    LIKE("LIKE"),
    /** like right 值% [可以用到索引，推荐使用] */
    LIKE_RIGHT("LIKE RIGHT"),
    LIKE_LEFT("LIKE LEFT"),
    NOT_LIKE("NOT LIKE"),
    /** 大于等于 and 小于等于 0 */
    RANGE("RANGE"),
    /** 大于 and 小于 0 */
    RANGE_NE("RANGE_NE"),
    /** 小于 and 大于 0 */
    NOT_RANGE("NOT_RANGE"),
    /** 针对ids，集合字段查询 */
    S_IN("S_IN"),
    EQ("="),
    NE("<>"),
    GT(">"),
    GE(">="),
    LT("<"),
    LE("<="),
    IS_NULL("IS NULL"),
    NOT_NULL("IS NOT NULL"),
    GROUP_BY("GROUP BY"),
    HAVING("HAVING"),
    ORDER_BY("ORDER BY"),
    ORDER_BY_ASC("ORDER BY ASC"),
    ORDER_BY_DESC("ORDER BY DESC"),
    EXISTS("EXISTS"),
    NOT_EXISTS("NOT EXISTS"),
    BETWEEN("BETWEEN"),
    NOT_BETWEEN("NOT BETWEEN"),
    UP("+"),
    DN("-"),
    SET("SET"),
    IS_EMPTY("IS NULL OR IS EMPTY"),
    NOT_EMPTY("IS NOT NULL AND IS NOT EMPTY")
    ;

    private final String key;

}